package com.wangmengtao.upms.controller;

import com.wangmengtao.upms.service.UpmsUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @ClassName: LoginController
 * @Description: Login
 * @Author: WangMengtao
 * @Date: 2019/6/13 16:28
 * @version: 1.0
 **/
@RestController
public class LoginController {
    @Autowired
    private UpmsUserService upmsUserService;

    @PostMapping(value = "/login")
    public Object login(String username, String password) throws Exception{
        return upmsUserService.getByPhone(username, password);
    }

    @GetMapping(value = "/logout")
    public String logout() {
        return "/login";
    }
}
